You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR allows providing any command line options to docker build by accepting them from an array of string instead of trying to define them all one by one.
For now, only --target & --cache-from are supported since #1555, but we cannot anticipate every single new options (as those used by buildx, or secret files, for instance).
Using an array of strings is not really readable when declaring options prefixed with a --. The alternative would be passing the options as a single or multilines string, but this would be a lot less flexible. What do you think about it ?
Thanks so much for your contribution! You're absolutely right that your proposed changes would make our manifests more nimble for Docker options; unfortunately, any manifest changes need to be backwards-compatible so existing workloads don't break. We can't consolidate our existing build options into a more general options field at this point.
We could theoretically add the options field and hide the existing --target and --cache-from fields but still handle them exactly as we have, combining them with any options in the options field. But your questions correctly suggest that the input and parsing of the list of options would require some amount of thought, guidance, and tons of validation.
Hi @huanjani , I don't get your point :-/ I've indeed added the options yaml field, while still handling old --target and --cache-from fields (even if they are not documented anymore), in order to avoid any bc break. What do you suggest I should add to the PR ?
lucix-aws
added
do-not-merge
Pull requests that mergify shouldn't merge until the requester allows it.
and removed
do-not-merge
Pull requests that mergify shouldn't merge until the requester allows it.
labels
Apr 7, 2025
What changes would be needed to this PR to get it merged?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows providing any command line options to
docker buildby accepting them from an array of string instead of trying to define them all one by one.For now, only
--target&--cache-fromare supported since #1555, but we cannot anticipate every single new options (as those used by buildx, or secret files, for instance).Example:
Using an array of strings is not really readable when declaring options prefixed with a
--. The alternative would be passing the options as a single or multilines string, but this would be a lot less flexible. What do you think about it ?Fixes #2090, fixes #3466
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.